package mrms.api.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "meeting", schema = "mrms", catalog = "")
public class MeetingEntity {
    private int id;
    private String theme;
    private Integer expectsize;
    private Long starttime;
    private Long endtime;
    private Integer attendance;
    private Integer state;
    private String attachment;
    private Integer invite;
    private String invitationcode;
    private Integer adjust;
    private String sponsor;
    private String room;
    private UserEntity sponsorDetail;
    private RoomEntity roomDetail;

    @Transient
    public UserEntity getSponsorDetail() {
        return sponsorDetail;
    }

    public void setSponsorDetail(UserEntity sponsorDetail) {
        this.sponsorDetail = sponsorDetail;
    }

    @Transient
    public RoomEntity getRoomDetail() {
        return roomDetail;
    }

    public void setRoomDetail(RoomEntity roomDetail) {
        this.roomDetail = roomDetail;
    }

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "theme")
    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    @Basic
    @Column(name = "expectsize")
    public Integer getExpectsize() {
        return expectsize;
    }

    public void setExpectsize(Integer expectsize) {
        this.expectsize = expectsize;
    }

    @Basic
    @Column(name = "starttime")
    public Long getStarttime() {
        return starttime;
    }

    public void setStarttime(Long starttime) {
        this.starttime = starttime;
    }

    @Basic
    @Column(name = "endtime")
    public Long getEndtime() {
        return endtime;
    }

    public void setEndtime(Long endtime) {
        this.endtime = endtime;
    }

    @Basic
    @Column(name = "attendance")
    public Integer getAttendance() {
        return attendance;
    }

    public void setAttendance(Integer attendance) {
        this.attendance = attendance;
    }

    @Basic
    @Column(name = "state")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Basic
    @Column(name = "attachment")
    public String getAttachment() {
        return attachment;
    }

    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }

    @Basic
    @Column(name = "invite")
    public Integer getInvite() {
        return invite;
    }

    public void setInvite(Integer invite) {
        this.invite = invite;
    }

    @Basic
    @Column(name = "invitationcode")
    public String getInvitationcode() {
        return invitationcode;
    }

    public void setInvitationcode(String invitationcode) {
        this.invitationcode = invitationcode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MeetingEntity that = (MeetingEntity) o;
        return id == that.id &&
                Objects.equals(theme, that.theme) &&
                Objects.equals(expectsize, that.expectsize) &&
                Objects.equals(starttime, that.starttime) &&
                Objects.equals(endtime, that.endtime) &&
                Objects.equals(attendance, that.attendance) &&
                Objects.equals(state, that.state) &&
                Objects.equals(attachment, that.attachment) &&
                Objects.equals(invite, that.invite) &&
                Objects.equals(invitationcode, that.invitationcode);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, theme, expectsize, starttime, endtime, attendance, state, attachment, invite, invitationcode);
    }

    @Basic
    @Column(name = "adjust")
    public Integer getAdjust() {
        return adjust;
    }

    public void setAdjust(Integer adjust) {
        this.adjust = adjust;
    }

    @Basic
    @Column(name = "sponsor")
    public String getSponsor() {
        return sponsor;
    }

    public void setSponsor(String sponsor) {
        this.sponsor = sponsor;
    }

    @Basic
    @Column(name = "room")
    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }
}
